package _enum;

import lombok.Getter;

/**
 * jdk5.0中使用enum定义枚举类
 */
@Getter
public enum Season implements Info, Show {
    // 1.必须在枚举类的开头声明多个对象。对象之间使用,隔开
    SPRING("春天", "春暖花开") {
        @Override
        public void show() {
            System.out.println("春天~~");
        }

        @Override
        public void info() {
            System.out.println("春天的~");
        }
    },
    SUMMER("夏天", "夏日炎炎") {
        @Override
        public void show() {
            System.out.println("夏天~~");
        }
    },
    AUTUMN("秋天", "硕果累累") {
        @Override
        public void show() {
            System.out.println("秋天~~");
        }
    },
    WINTER("冬天", "寒气逼人") {
        @Override
        public void show() {
            System.out.println("冬天~~");
        }
    };

    // 2.声明当前类的对象的实例变量， 使用private final修饰
    private final String seasonName;
    private final String seasonDesc;

    // 3.私有化类的构造器
    Season(String seasonName, String seasonDesc) {
        this.seasonName = seasonName;
        this.seasonDesc = seasonDesc;
    }

    @Override
    public String toString() {
        return "Season{" +
                "seasonName='" + seasonName + '\'' +
                ", seasonDesc='" + seasonDesc + '\'' +
                '}';
    }

    @Override
    public void info() {
        System.out.println(this);
    }
}

